/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * buscaDocFinVer.java
 *
 * Created on 05/05/2009, 00:05:07
 */

package siga.visao_busca;

import siga.visao.index;

/**
 *
 * @author rafaelfrasson
 */
public class buscaDocFinVer extends javax.swing.JDialog {

    public static boolean ConfirmaBuscaDoc;
    public static boolean isConfirmaBuscaDoc() {
        return ConfirmaBuscaDoc;
    }
    public static void setConfirmaBuscaDoc(boolean ConfirmaBuscaDoc) {
        buscaDocFinVer.ConfirmaBuscaDoc = ConfirmaBuscaDoc;
    }

    public buscaDocFinVer(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jpBDFVPrincipal = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jtfCodigo = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jtfDtPag = new javax.swing.JFormattedTextField();
        jLabel3 = new javax.swing.JLabel();
        jtfDtVenc = new javax.swing.JFormattedTextField();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jtfVlRec = new javax.swing.JTextField();
        jtfVlBruto = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();
        jtfDescricao = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jtfDtVencIni = new javax.swing.JFormattedTextField();
        jtfDtVencFim = new javax.swing.JFormattedTextField();
        jLabel9 = new javax.swing.JLabel();
        jtfDtPgtoIni = new javax.swing.JFormattedTextField();
        jLabel10 = new javax.swing.JLabel();
        jtfDtPgtoFim = new javax.swing.JFormattedTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Busca por Documentos");

        jpBDFVPrincipal.setName("jpBDFVPrincipal"); // NOI18N

        jLabel1.setText("Número do Documento:");
        jLabel1.setName("jLabel1"); // NOI18N

        jtfCodigo.setName("jtfCodigo"); // NOI18N

        jLabel2.setText("Data de Pgto/Rec.:");
        jLabel2.setName("jLabel2"); // NOI18N

        try {
            jtfDtPag.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtfDtPag.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jtfDtPag.setName("jtfDtPag"); // NOI18N

        jLabel3.setText("Data de Vencimento:");
        jLabel3.setName("jLabel3"); // NOI18N

        try {
            jtfDtVenc.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtfDtVenc.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jtfDtVenc.setName("jtfDtVenc"); // NOI18N

        jLabel4.setText("Valor Bruto:");
        jLabel4.setName("jLabel4"); // NOI18N

        jLabel5.setText("Valor Recebido/Pago:");
        jLabel5.setName("jLabel5"); // NOI18N

        jtfVlRec.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        jtfVlRec.setName("jtfVlRec"); // NOI18N

        jtfVlBruto.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        jtfVlBruto.setName("jtfVlBruto"); // NOI18N

        jButton1.setText("Filtrar");
        jButton1.setName("jButton1"); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("Cancelar");
        jButton2.setName("jButton2"); // NOI18N
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jLabel6.setText("Histórico:");
        jLabel6.setName("jLabel6"); // NOI18N

        jtfDescricao.setName("jtfDescricao"); // NOI18N

        jLabel7.setText("Período de Vencimento:");
        jLabel7.setName("jLabel7"); // NOI18N

        jLabel8.setText("até");
        jLabel8.setName("jLabel8"); // NOI18N

        try {
            jtfDtVencIni.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtfDtVencIni.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jtfDtVencIni.setName("jtfDtVencIni"); // NOI18N

        try {
            jtfDtVencFim.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtfDtVencFim.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jtfDtVencFim.setName("jtfDtVencFim"); // NOI18N

        jLabel9.setText("Período de Pgto / Recebimento:");
        jLabel9.setName("jLabel9"); // NOI18N

        try {
            jtfDtPgtoIni.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtfDtPgtoIni.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jtfDtPgtoIni.setName("jtfDtPgtoIni"); // NOI18N

        jLabel10.setText("até");
        jLabel10.setName("jLabel10"); // NOI18N

        try {
            jtfDtPgtoFim.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtfDtPgtoFim.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jtfDtPgtoFim.setName("jtfDtPgtoFim"); // NOI18N

        javax.swing.GroupLayout jpBDFVPrincipalLayout = new javax.swing.GroupLayout(jpBDFVPrincipal);
        jpBDFVPrincipal.setLayout(jpBDFVPrincipalLayout);
        jpBDFVPrincipalLayout.setHorizontalGroup(
            jpBDFVPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpBDFVPrincipalLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpBDFVPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpBDFVPrincipalLayout.createSequentialGroup()
                        .addGroup(jpBDFVPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jtfCodigo, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jpBDFVPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jtfDescricao, javax.swing.GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE)
                            .addComponent(jLabel6)))
                    .addGroup(jpBDFVPrincipalLayout.createSequentialGroup()
                        .addGroup(jpBDFVPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jtfDtVenc)
                            .addComponent(jLabel3))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jpBDFVPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jtfDtPag)
                            .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jpBDFVPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4)
                            .addComponent(jtfVlBruto, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jpBDFVPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jtfVlRec, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)
                            .addComponent(jLabel5)))
                    .addGroup(jpBDFVPrincipalLayout.createSequentialGroup()
                        .addGroup(jpBDFVPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel7)
                            .addGroup(jpBDFVPrincipalLayout.createSequentialGroup()
                                .addComponent(jtfDtVencIni, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel8)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtfDtVencFim, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(18, 18, 18)
                        .addGroup(jpBDFVPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel9)
                            .addGroup(jpBDFVPrincipalLayout.createSequentialGroup()
                                .addComponent(jtfDtPgtoIni, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel10)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtfDtPgtoFim, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpBDFVPrincipalLayout.createSequentialGroup()
                        .addComponent(jButton1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton2)))
                .addContainerGap())
        );
        jpBDFVPrincipalLayout.setVerticalGroup(
            jpBDFVPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpBDFVPrincipalLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpBDFVPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpBDFVPrincipalLayout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jpBDFVPrincipalLayout.createSequentialGroup()
                        .addComponent(jLabel6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfDescricao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpBDFVPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpBDFVPrincipalLayout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfDtPag, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jpBDFVPrincipalLayout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfVlRec, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jpBDFVPrincipalLayout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfVlBruto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jpBDFVPrincipalLayout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfDtVenc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jpBDFVPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jpBDFVPrincipalLayout.createSequentialGroup()
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jpBDFVPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jtfDtVencIni, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel8)
                            .addComponent(jtfDtVencFim, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jpBDFVPrincipalLayout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jpBDFVPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jtfDtPgtoIni, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel10)
                            .addComponent(jtfDtPgtoFim, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jpBDFVPrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton1)
                    .addComponent(jButton2))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jpBDFVPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jpBDFVPrincipal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        dispose();
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        setConfirmaBuscaDoc(true);
        index.pesquisa.add(0,jtfCodigo.getText());
        index.pesquisa.add(1,jtfDtVenc.getText());
        index.pesquisa.add(2,jtfDtPag.getText());
        index.pesquisa.add(3,jtfVlBruto.getText());
        index.pesquisa.add(4,jtfVlRec.getText());
        index.pesquisa.add(5,jtfDescricao.getText());
        index.pesquisa.add(6,jtfDtVencIni.getText());
        index.pesquisa.add(7,jtfDtVencFim.getText());
        index.pesquisa.add(8,jtfDtPgtoIni.getText());
        index.pesquisa.add(9,jtfDtPgtoFim.getText());
        dispose();
    }//GEN-LAST:event_jButton1ActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jpBDFVPrincipal;
    private javax.swing.JTextField jtfCodigo;
    private javax.swing.JTextField jtfDescricao;
    private javax.swing.JFormattedTextField jtfDtPag;
    private javax.swing.JFormattedTextField jtfDtPgtoFim;
    private javax.swing.JFormattedTextField jtfDtPgtoIni;
    private javax.swing.JFormattedTextField jtfDtVenc;
    private javax.swing.JFormattedTextField jtfDtVencFim;
    private javax.swing.JFormattedTextField jtfDtVencIni;
    private javax.swing.JTextField jtfVlBruto;
    private javax.swing.JTextField jtfVlRec;
    // End of variables declaration//GEN-END:variables

}
